﻿using LJX.SmartPark.Common.Extensions;
using LJX.SmartPark.Common.ResponseOutput;
using LJX.SmartPark.Domain.Area;
using LJX.SmartPark.Service.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DB = LJX.SmartPark.Service.Area.PromptScreen.Dto;

namespace LJX.SmartPark.Service.Area.PromptScreen
{
    public class PromptScreenServeics : IPromptScreenServeics
    {
        //注入
        private readonly IRepository<PromptScreenStatus> _studentService;

        public PromptScreenServeics(IRepository<PromptScreenStatus> studentService)
        {
            _studentService = studentService;
        }

        /// <summary>
        /// 显示分页
        /// </summary>
        /// <param name="prompt"></param>
        /// <returns></returns>
        public async Task<Response<List<PromptScreenStatus>>> GetTricolourLightLogAsync(DB.PromptScreen input)
        {
            var students = _studentService.GetListQuery();
            var totalCount = students.Count();
            students = students.Skip(((input.pageIndex - 1) * input.pageSize)).Take(input.pageSize);
            var result = students.MapToList<PromptScreenStatus>();
            return Response<List<PromptScreenStatus>>.Ok(result, totalCount);
        }
    }
}
